package com.juku2024.juku.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.juku2024.juku.fragment.DownloadFinishedFragment
import com.juku2024.juku.fragment.DownloadingFragment

class DownloadTagFragmentAdapter(fragment: FragmentActivity) :
    FragmentStateAdapter(fragment) {

    val tabNames by lazy { arrayOf("正在下载", "下载完成") }
    private val fragments by lazy { arrayListOf(DownloadingFragment(), DownloadFinishedFragment()) }


    override fun getItemCount(): Int {
        return fragments.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragments[position]
    }

}

